// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/elemac/api/DeviceHospitalApi'

import ComClass from '@api/ComQuery'
import ListClass from '@api/elemac/model/DeviceHospitalQueryReq'
import OneClass from '@api/elemac/model/DeviceHospitalDetailReq'
import SummaryClass from '@api/elemac/model/DeviceHospitalSummaryReq'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  async getList(param, TIP = '查询医院机电设备列表') {
    const req = CORE.grpcDTO(ListClass, param, [ComClass, 'comQuery'])
    const res = await CORE.grpc(TIP, CLIENT, 'deviceHospitalQuery', req)
    return res
  },
  async getDetail(param, TIP = '查询医院机电设备详情') {
    const req = CORE.grpcDTO(OneClass, param)
    const res = await CORE.grpc(TIP, CLIENT, 'deviceHospitalDetail', req)
    return res
  },
  async getSummary(param = {
    /**
     * @description 系统标识
     * - 1给水系统
     * - 2冷源系统
     * - 3热源系统
     */
    systemTag: 1,
  }, TIP = '机电设备数据汇总信息(本接口为需求不确定的时候临时接口,后续会大改甚至删除)') {
    const req = CORE.grpcDTO(SummaryClass, param)
    const res = await CORE.grpc(TIP, CLIENT, 'deviceHospitalSummary', req)
    return res
  },
}
